package com.tangly.codeing.controller;

import com.tangly.codeing.service.FileService;
import com.tangly.codeing.utils.ReturnT;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 文件操作
 *
 * @author tangbing
 * @date 2020/8/12
 */
@RestController
@RequestMapping("file")
public class FileController extends BaseController {

    @Resource
    private FileService fileService;

    /**
     * 新增
     */
    @GetMapping("/fileToDfsServer/{fileId}")
    public ReturnT<String> fileToDfsServer(@PathVariable(value = "fileId", required = false) String fileId) {
        return fileService.fileToDfsServer(fileId);
    }
}
